home *** CD-ROM | disk | FTP | other *** search
- Path: populus.slu.se!newsmgr
- From: Thomas.Johansson@stax.slu.se (Thomas Johansson)
- Newsgroups: comp.lang.c++
- Subject: Re: [Q]Assigning function pointer in C/C++.
- Date: 23 Jan 1996 11:41:55 GMT
- Organization: SLU UmeĎ
- Message-ID: <4e2hi3$pbd@populus.slu.se>
- References: <DL3JJu.5nB.0.queen@torfree.net> <4doc42$gsb@bmdhh222.bnr.ca> <ALUN.CHAMPION.96Jan19113523@g7240065.bridge.bst.bls.com> <4e09re$kit@populus.sl <4e0o5l$fjc@colossus.holonet.net>
- NNTP-Posting-Host: b93.resgeom.slu.se
- X-Newsreader: WinVN 0.92.1
-
- In article <4e0o5l$fjc@colossus.holonet.net>, russell@news.mdli.com (Russell Blackadar) says:
- >BTW, you don't *have* to use a typedef.
- >
- >: Fp f = (a.*p); // the object a (of class A) has a member p
- >
- >Should be
- > Fp f = &A::p; // where int p(void) is a member-function of A
- >
- >: int z = f();
- >
- >Should be
- > int z = (a.*f)(); // note parens, .* has low precedence
- >
- >The operators .* and ->* are used to call the function, not to
- >initialize the pointer.
- >
-
- Thats just the point I would like to make : I would like to store the
- 'final' pointer value, not the offset into the class that f represents.
- I would like to bind the object an the offset, then store the pointer
- to use at a later stage (a callback function). I do not have access to
- the original object when it comes to calling f. This is propably
- impossible in C++, I just wanted confirmation on that so that I can
- seek other methods.
-
-
-
-
- Regards
-
- Thomas J
-